package org.fle4y.example.aio.sendfile;

import java.nio.ByteBuffer;
import org.fle4y.framework.net.Message;
import org.fle4y.framework.net.Protocal;

/**
 * author : xiehui<br>
 * company : northking <br>
 * Create at: 2012-6-10<br>
 * @version : 1.0<br>
 * mailto:flexie@foxmail.com<br>
 *  Description :  文件传输协议
 */
public class FileProtocal implements Protocal{
	public Message transfer(ByteBuffer buffer) {
		Message m  = new FileMessage();
		byte[] dest=new byte[buffer.limit()];
		buffer.get(dest);
		m.setContent(	ByteBuffer.wrap(dest));
		return m;
	}
}
